<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>通知申请</title>
</head>
<body>
	<script type="text/javascript">
		$(function(){
			$('#notice_form').form('load','get_notice');
		})
	</script>
	<script type="text/javascript">
		$(function(){
			$("#notice_save").linkbutton({
				onClick : function() {
					$("#notice_form").form("submit",{
						url : "save_notice",
						onSubmit : function(params) {
							return $(this).form('enableValidation').form('validate');
						},
						success : function(data) {
							if (data=='true') {
								$("#quit_form").form("clear");
								//获取选中的面板
								var tab = $('#tt').tabs('getSelected');
								//根据选中的面板获取该面板的索引
								var index = $('#tt').tabs('getTabIndex',tab);
								//根据索引关闭
								if(index != 0){
									$('#tt').tabs('close',index);
								}
							}
							$.messager.alert("消息",data=='true' ? "保存成功！" : "保存失败！");
						}
					});
				}
			});
			$("#notice_submit").linkbutton({
				onClick : function() {
					$("#notice_form").form("submit",{
						url : "submit_notice",
						onSubmit : function(params) {
							params.pk = 'notice_act';
							return $(this).form('enableValidation').form('validate');
						},
						success : function(data) {
							if (data=='true') {
								$("#quit_form").form("clear");
								//获取选中的面板
								var tab = $('#tt').tabs('getSelected');
								//根据选中的面板获取该面板的索引
								var index = $('#tt').tabs('getTabIndex',tab);
								//根据索引关闭
								if(index != 0){
									$('#tt').tabs('close',index);
								}
							}
							$.messager.alert("消息",data=='true' ? "保存成功！" : "保存失败！");
						}
					});
				}
			});
		})
	</script>
	<div class="easyui-layout" fit="true">
		<div data-options="region:'center'" align="center" style="border: none;">
			<form id="notice_form" method="post">
				<table class="table" style="margin:10px; width: 70%" border="0" cellpadding="0" cellspacing="0">
					<thead>
						<tr align="center">
							<th colspan="5" style="font-size: 17px">通知申请单</th>
						</tr>
					</thead>
					<tbody>
						<tr>
							<td>
								<!-- emp_name 姓名 -->
								<input name="empName" class="easyui-textbox" labelAlign="right"
									style="width: 30%;" label="发起人：" editable="false">
								<!-- notice_uptime 申请日期 -->
								<input name="noticeUptime" class="easyui-datebox" labelAlign="right"
									style="width: 30%;" label="申请日期：" readonly="readonly"></input>
								<!-- dept_name 部门名称 -->
								<input name="deptName" class="easyui-textbox" labelAlign="right"
									style="width: 30%;" label="部门：" editable="false">
								<!-- 隐藏的员工id -->
								<input name="empId"  type="hidden">
							</td>
						</tr>
						<tr>
							<td>
								<!-- notice_level 通知申请级别 -->
								<select name="noticeLevel" class="easyui-combobox" style="width: 30%;"  
										label="申请类型：" labelAlign='right' editable="false" required>
									<option value="deptnotice">部门通知</option>
									<option value="compnynotice">公司通知</option>
								</select>
								<!-- notice_title 通知申请标题 -->
								<input name="noticeTitle" class="easyui-textbox" labelAlign="right" required
									style="width: 30%;" label="标题：">
							</td>
						</tr>
						<tr>
							<td>
								<!-- notice_context 通知申请内容 -->
								<input name="noticeContext" class="easyui-textbox" style="width:80%;height:100px;" label="通知申请内容："
									multiline="true" labelWidth="120%" required  labelAlign="right">
								<input name="lunchPeople"  type="hidden">
							</td>
						</tr>
						<tr>
							<td style="text-align: center">
								<a id="notice_save" class="easyui-linkbutton"
									data-options="iconCls:'icon-save',text:'暂存'"></a>
								<a id="notice_submit" class="easyui-linkbutton"
									data-options="iconCls:'icon-submit',text:'提交'"></a>
							</td>
						</tr>
					</tbody>
				</table>
			</form>
		</div>
	</div>
</body>
</html>